<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //注释
        /*注释*/

        //1.输出内容
        //①警告框  原样输出字符串
        //alert("我是输出的内容");

        //②在HTML文档中输出内容 支持html标签+css
        document.write("Hello world!");
        document.write("<h1 style='color:red;'>Hello world!</h1>");
        document.write("Hello world!");
        document.write("Hello world!");

        //③在浏览器控制台输出内容
        console.log("看我在哪里？？");

        //2.js中的变量（js中变量与数据类型无关）
        //语法： var | let | const  变量名;

        //①var+变量:表示的全局变量,定义后整个script都可以使用
        var age;
        age = 18;
        //console.log(age);

        // age = "好好学习";
        // console.log(age);

        //②let+变量：表示的局部变量
        let name;



        if (age >= 18) {
            var a = 999;
            let b = 888;
            console.log(age + ',1');
        }

        {
            var a = 999;
            //var a = 999;
            let b = 888;
            //let b = 888;
            console.log(age + ',1');
        }



        //③const 定义常量 不允许赋值
        const PI = 3.14;
        PI = 5.14;


        console.log(age + ",2");
        //console.log(b + ",2"); //no defind未定义


        











        var 锄禾日当午 = "天天向上";
        address = "中国昆明";





    </script>
</head>

<body>

</body>

</html>